﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using LaughingDog.Managers;

namespace LaughingDog.GameObjects
{
    /// <summary>
    /// A MouseCursor is simply a Sprite object that has its transforms position set to the position of the mouse on every frame.
    /// </summary>
    public class MouseCursor : Sprite
    {
        /// <summary>
        /// Creates a new instance of a MouseCursor object.
        /// </summary>
        /// <param name="assetName">The name of the texture file to use for the default cursor image.</param>
        public MouseCursor(String assetName)
            : base(assetName)
        {
            Renderer.LayerDepth = 1.0f;
        }

        /// <summary>
        /// Creates a new instance of a MouseCursor object.
        /// </summary>
        /// <param name="texture">The Texture2D to use for the default cursor image.</param>
        public MouseCursor(Texture2D texture)
            : base(texture)
        {
            Renderer.LayerDepth = 1.0f;
        }

        /// <summary>
        /// Updates the MouseCursor object.
        /// </summary>
        public override void Update()
        {
            Transform.Position = InputManager.Instance.Mouse.Position;

            base.Update();
        }
    }
}
